[Chapter 4] Configuring with m4
Author: Bryan Costales & Eric Allman
Date: 1999-02-04T00:04:33Z

#

| Chapter 4 |

# 4. Configuring with m4

Contents:
Special Local Parameters
FEATURE Declarations
MAILER Declarations
Virtual User Tables
Mailer Tables
Hints

A configuration file is generated from an m4 source file (e.g., one named our.mc) in the cf/cf sendmail source tree like this:

>     m4  ../m4/cf.m4 our.mc > sendmail.cf

To use a directory other than ../m4, use:

>     m4 -D_CF_DIR_=path/ path/m4/cf.m4 our.mc >
>       sendmail.cf

Here, path is the full path to the m4/cf.m4 file. The our.mc source may contain the following lines (in this order):

>     OSTYPE(os)
>     DOMAIN(domain)
>                            declare local parameters using
>                              define here
>     FEATURE(feature)       can be several
>     MAILER(agent)          can be several
>                            local rule set declarations here

Thus, a minimal file would declare the operating system and local delivery agent support with two lines like this:

>     OSTYPE(os)
>     MAILER(local)

In some cases you may see lines terminated with dnl, which means "delete to new line." Its use prevents extra blank lines from appearing in the output. It is almost never required. For more details about the m4 technique in general, see §19.2.

OSTYPE

  Causes support to be included from one of the files in the cf/ostype directory.

  >     OSTYPE(os)

  This sets defaults for your operating system from the file cf/ostype/os.m4 (as for example, sunos4.1.m4). If you want to change any of the defaults that come with your operating system's file, do so after declaring OSTYPE. (See §19.3.1).

DOMAIN

  Collects together local paramater declarations for an (optional) administrative domain:

  >     DOMAIN(domain)

  Here, domain is the name of a file in the cf/domain directory. With the exception of the file called generic, you should create your own domain file (see §19.3.3).

local parameter declarations

  Are (mostly) named confNAME, and most all cases are declared using the `define` directive:

  >     define(`parameter_name', `value')

  the parameter_names define options and macros (see Chapter 2, The sendmail.cf File). In some cases local parameters are declared using special macros; see the next section.

FEATURE

  Supplies simple solutions to special needs. The FEATURE directive is described below.

MAILER

  Causes support for delivery agents to be included. It must follow local parameter declarations because some of them change how a MAILER directive will be interpreted. MAILER is detailed following the features.

local rule set declarations

  Allow you to easily add rules and rule sets to your configuration file. Each definition stands on a line by itself, and the lines following each are included in the appropriate place in the configuration file. For example: LOCAL_CONFIG to add general declarations (e.g., K configuration databases) that should go at the top of the configuration file (see §19.6.30); LOCAL_RULE_0 to add rules to rule set 0 (see §19.6.32); LOCAL_RULE_1 to add rules to rule set 1 (see §19.6.33); LOCAL_RULE_2 to add rules to rule set 2 (see §19.6.34); LOCAL_RULE_3 to add rules to rule set 3 (see §19.6.35); and LOCAL_RULESETS to declare entirely new rule sets, such as check_relay (see §19.6.36). Also select from: LOCAL_NET_CONFIG (used in conjunction with LOCAL_RELAY) to add rules that tell what addresses should not be forwarded to the relay (see §19.6.37); and MAILER_DEFINITIONS to define new delivery agents and the rule sets associated with them (see §19.6.40).

## 4.1 Special Local Parameters

These lines should go in the DOMAIN file or before FEATURE declarations (because they precondition certain features).

EXPOSED_USER(user)

  (Used with MASQUERADE_AS) tells what users should not be masqueraded (see §19.6.4).

GENERICS_DOMAIN(domain)

  Lists the names of domains that will be looked up with the genericstable feature. Declare one domain per line. There may be several such lines.

GENERICS_DOMAIN_FILE(file)

  Specifies the file that contains the domains that will be looked up with the generic\%stable feature.

MASQUERADE_AS(domain)

  Causes all outgoing addresses to be rewritten as though they came from the indicated domain (see §19.6.42).

MASQUERADE_DOMAIN(domain)

  Specifies additional domains that will be translated into the MASQUERADE_AS domain. See also the limited_masquerade feature (see §19.6.43).

MASQUERADE_DOMAIN_FILE(file)

  Specifies the name of the file that contains a list of domains that will be masqueraded (see §19.6.44).

3.10 Hints |  | 4.2 FEATURE Declarations